package com.arpa.wms.scheduled.domain.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * 基础数据启用、停用状态
 * @program: wms
 * @description:
 * @author: xuyang
 * @create: 2020-08-10 10:21
 */
public enum StatusEnum implements IEnum<String> {
    /**
     * 基础数据启用、停用状态
     */
    ACTIVE("0", "启用"),
    UNACTIVE("1", "停用");

    /**
     * 值
     */
    private final String value;

    /**
     * 描述
     */
    private final String desc;

    StatusEnum(final String value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    private static final Map<String,StatusEnum>  map = new HashMap();

    static {
        StatusEnum[] values = values();
        int length = values.length;
        for(int i = 0; i < length; i++){
            StatusEnum value1 = values[i];
            map.put(value1.getValue(),value1);
        }
    }

    public static StatusEnum getEnumByValue(String value){

        return map.get(value);
    }
    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String toString(){
        return this.desc;
    }

    public String getDesc() {
        return this.desc;
    }
}
